const { defineConfig } = require('@vue/cli-service')
const baseUrl = 'http://chunfengai.top:28081'

function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = defineConfig({
  transpileDependencies: true,
  pages: {
    index: {
      entry: 'src/main.js',
      template: 'public/index.html',
      title: '首页',
    },
  },
  devServer: {
    // 使用代理进行解决跨域的问题
    host: 'localhost',
    open: true,
    port: 8081,
    proxy: {
      '/': {
        target: baseUrl,
        changeOrigin: true,
        ws: false,
        logLevel: 'debug',
      },
    },
  },
  configureWebpack: {
    devtool: false,
    plugins: [
      //new BundleAnalyzerPlugin(),
      // new MomentLocalesPlugin(),
    ],
  },
})
